<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="DaosImpl.ClientDaoImpl" %>
<%@ page import="Beans.Client" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<%
		String path = request.getContextPath();
		String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
	 %>
  <head>
     <meta charset="UTF-8">
    <title>个人信息</title>
    <link href=<%=basePath+"/stylesheets/myInfo.css" %> type="text/css" rel="stylesheet">
    <style>
        html,body{
            height: 100%;
            margin:0;
            padding: 0;
        }
    </style>

  </head>
  
  <body>
  <%
  		String msg = (String)session.getAttribute("msg");
  		if(msg!=null&&msg!=""){
  			%>
  					<script type="text/javascript" language="javascript">
  						var msg = '<%=msg%>'
	    				alert(msg);
	    			</script>
  			<%
  		}
  		session.removeAttribute("msg");
  %>
    <div id="themeText">个人信息查看</div>
	<div id="showRoomFrame">
		<table cellpadding="0" cellspacing="0">
	        <thead>
	        <tr>
	            <th>顾客姓名</th>
	            <th>身份证</th>
	            <th>年龄</th>
	            <th>电话</th>
	            <th>性别</th>
	            <th>操作</th>
	        </tr>
	        </thead>
	        <tbody>
	        <%
				String myAccount = "";
	        	myAccount = (String)session.getAttribute("account");
	        	System.out.println(myAccount);
	        	Client client = new Client();
	        	ClientDaoImpl clientDao = new ClientDaoImpl();
	        	String id = clientDao.queryClientId(myAccount);
	        	client = clientDao.queryMyInfo(id);
	        	%>
	        	<tr>
	            	<td width="15%"><%=client.getName() %></td>
	            	<td width="20%"><%=client.getId() %></td>
	            	<td width="15%"><%=client.getAge() %></td>
	            	<td width="20%"><%=client.getPhone() %></td>
	            	<td width="15%"><%=client.getSex() %></td>
	            	<td width="15%">
	            		<button style="padding: 5px 15px;border: 1px solid orange;border-radius: 5px;background-color: orange" id="amendBtn" onclick="showDlg('<%=client.getName()%>','<%=client.getId()%>','<%=client.getAge()%>','<%=client.getPhone()%>','<%=client.getSex()%>','<%=client.getBlackList()%>')">修改信息</button>
	            	</td>
	        	</tr>
	        	<%
	         %>
	        </tbody>
    	</table>
    	<div id="mask">
            <div class="mask">
                <div class="title">
                    编辑
                    <span onclick="closeDlg()">X</span>
                </div>
                <div class="content">
                    <form action="/HotelSystem/Servlets/AmendMyInfoServlet" method="post">
                        <div>
                            <span>顾 客 姓 名：&nbsp;</span>
                            <input type="text" name="name" value="" placeholder="顾客姓名" id="name">
                        </div>
                        <div>
                            <span>身&nbsp;&nbsp;份&nbsp;&nbsp;证：&nbsp;&nbsp;&nbsp;</span>
                            <input type="text" name="idcard" value="" placeholder="身份证" id="idcard">
                        </div>
                        <div>
                            <span>年&nbsp;&nbsp;龄&nbsp;&nbsp;：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                            <input type="text" name="age" value="" placeholder="年龄" id="age">
                        </div>
                        <div>
                            <span>电&nbsp;&nbsp;话：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                            <input type="text" name="phone" value="" placeholder="电话" id="phone">
                        </div>
                        <div>
                            <span>性&nbsp;&nbsp;别：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                            <input type="text" name="sex" value="" placeholder="性别" id="sex">
                        </div>
                        <input type="hidden" name="blackList" value="否" placeholder="是否黑名单" readonly=”readonly” id="blackList">
                        <input type="hidden" value="" name="lastid" id="lastid">
                        <div>
                            <input value="更新" type="submit" class="amendBtn" style="width: 56px" id="updateBtn">
                            <button onclick="closeDlg()" type="button">取消</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
	</div>
  </body>
  <script src="javascripts/myInfo.js"></script>
</html>
